{% extends "topic/base.html" %}
{% block title %}Mail{% endblock%}
{% block main %}

<div id="main">
  <div id="content">
    <div class="panel">
        <div class="header">
          <span class="col_fade">发送邮件</span>
        </div>
        <div class="inner">
          <form method="post" action="{{ url_for('.add') }}">
            <label class="control-label">内容</label>
              <div class="controls">
                <input type="text" name="content" placeholder="content">
              </div>
            <label class="control-label">标题</label>
              <div class="controls">
                <input type="text" name="title" placeholder="title">
              </div>
            <label class="control-label">收件人ID</label>
              <div class="controls">
                <input type="text" name="receiver_id" placeholder="receiver_id">
              </div>
            <button type="submit">发送邮件</button>
          </form>
        </div>
    </div>
    <div class="panel">
        <div class="header">
          <span class="col_fade">收到邮件</span>
        </div>
        <div class="inner">
          {% for r in received %}
            <div>
              <a href="{{ url_for('.view', id = r.id) }}"> {{ r.title }}</a>
            </div>
          {% endfor %}
        </div>
    </div>
    <div class="panel">
        <div class="header">
          <span class="col_fade">已发邮件</span>
        </div>
        <div class="inner">
          {% for s in send %}
            <div>
              <a href="{{ url_for('.view', id = s.id) }}"> {{ s.title }}</a>
            </div>
          {% endfor %}
        </div>
    </div>
  </div>

</div>

{% endblock %}